﻿using Microsoft.Extensions.Logging;
using System;

namespace MangoCannon.Framework.Util
{
    public class Logger
    {
        private static Logger myLogger;
        private static ILoggerFactory factory;
        private Logger()
        {
           
        }
        
        public static Logger getLogger()
        {
            if (myLogger == null)
            {
                myLogger = new Logger();
            }
            return myLogger;
        }

        public void init()
        {
            //factory = new LoggerFactory().AddNLog();
        }


        /// <summary>
        /// 以Info等级写文本日志
        /// </summary>
        /// <param name="nowObj"></param>
        /// <param name="msg"></param>
        public void writeLog(object nowObj, string msg)
        {
            Console.WriteLine(msg);
        }

        /// <summary>
        /// 以Info等级写异常日志
        /// </summary>
        /// <param name="nowObj"></param>
        /// <param name="msg"></param>
        /// <param name="e"></param>
        public void writeLog(object nowObj, string msg, Exception e)
        {

        }
        /// <summary>
        /// 以错误等级写文本日志
        /// </summary>
        /// <param name="nowObj">当前对象</param>
        /// <param name="msg">写入的信息</param>
        public void writeError(object nowObj, string msg)
        {

        }
        /// <summary>
        /// 以错误等级写异常日志
        /// </summary>
        /// <param name="nowObj">当前对象</param>
        /// <param name="msg">写入的信息</param>
        /// <param name="e">写入的异常</param>
        public void writeError(object nowObj,string msg,Exception e)
        {

        }
    }
}
